<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>计算属性</title>

</head>
<body>
<div id="app">
    {{birth}}
    {{new Date(birthday).getFullYear()}}
</div>

<script src="./node_modules/vue/dist/vue.js"></script>
<script>
    var app = new Vue({
        el: "#app",
        data: {
            birthday:1529032123201 // 毫秒值

        },
        computed:{
            birth(){
                return new Date(this.birthday).getFullYear()
            }
        }


    })
</script>
</body>
</body>
</html>